package com.vision.sales.cl.ui.component;

import com.google.gwt.cell.client.AbstractCell;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.vision.sales.cm.data.TransactionStatus;

/**
 * 
 * @author Mark
 *
 */
public class TransactionStatusCell extends AbstractCell<TransactionStatus> {
	
	public static TransactionStatusCell INSTANCE = new TransactionStatusCell();
	
	private TransactionStatusCell() {
	}

	@Override
	public void render(Context context, TransactionStatus status, SafeHtmlBuilder sb) {
		String style = "style='color: " + (status == TransactionStatus.PENDING ? "red" : "green") + "'";
		String v = status.name();
        sb.appendHtmlConstant("<span " + style + " qtitle='' qtip='" + v + "'>" + v + "</span>");
	}

}
